package com.itheima.thread.线程创建.demo2;

public class Demo {
    public static void main(String[] args) {
        //创建任务对象
        MyRunnable mr = new MyRunnable();
        //创建线程对象,并交代线程要执行的任务
        Thread t1 = new Thread(mr);
        t1.setName("刘岩");

        Thread t2 = new Thread(mr);
        t2.setName("刘亦菲");

        //开启线程
        t1.start();
        t2.start();

        System.out.println("Thread.currentThread().getName() = " + Thread.currentThread().getName());
    }
}
